<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>个人中心</title>
    <link href="../css/public.css" rel="stylesheet"/>
    <link href="../css/view.css" rel="stylesheet"/>
    <link href="../css/tipbox.css" rel="stylesheet" type="text/css"/>
    <!--foot-->
    <link href="../css/public_1.css" rel="stylesheet" media="all"/>
    <style></style>
    <script src="../js/vue2.5.17.js"></script>
    <script src="../js/kindeditor-all.js"></script>
    <script src="../js/lang/zh-CN.js"></script>
    <script type="text/javascript" src="../js/jquery1.7.js"></script>
    <script src="../../admin/layui/layui.all.js"></script>
    <link rel="stylesheet" href="../../admin/layui/css/layui.css">
</head>
<body>
<div>


    <div class="header_bg">
        <div class="header wap">
            <div class="logo"><a href="/index.html" title="权名众筹系统">权名众筹系统</a></div>
            <div class="nav cfff">
                <ul>
                    <li class="nav_a1"><a href="/index.html">首页</a></li>
                    <li class="nav_a2"><a href="/home/list.html?projectName=&page=1&limit=10&type=0">全部项目</a></li>
                    <li class="nav_a4"><a href="/home/apply.html">发布项目</a></li>                 <li class="nav_a5"><a href="/admin/index.html#/user/login">后台管理</a></li>


                </ul>
            </div>
            <div class="h_right">
                <ul class="h_login h_user displayNone"
                    v-bind:class="[userInfo.code===101 ? 'displayInlineBlock':'displayNone']" id="login_panel">
                <span>
                            <li class="hl_login"><a href="/home/login.html" class="h_login_ring">登录</a></li>
                            <li class="hl_reg"><a href="/home/sign.html" class="h_login_join">注册</a></li>
                            <li class="qq_login"><a href="#" title="QQ登陆">QQ登录</a></li>
                </span>
                    <li class="help_login"><a href="#">帮助</a></li>
                </ul>
                <ul class="h_login  h_reg displayNone"
                    v-bind:class="[userInfo.code===0 ? 'displayInlineBlock':'displayNone']" id="login_info">
                    <div>
                        <li class="h_name"><a href="/home/user/user.html">{{userInfo.data!=null
                            ?userInfo.data.username:''}}</a>
                            <div class="popup name_popup cfff displayNone">
                                <a href="/home/user/user.html">我的帐户</a>
                                <a href="/home/logout">安全退出</a>
                            </div>
                        </li>
                        <li class="h_message"><a href="#" id="notify">提醒</a>
                            <div class="popup message_popup cfff displayNone">
                                <a href="#" id="unread">未读通知 </a>
                                <a href="#" id="unreview">待评价项目 </a>
                                <a href="#" id="uncash">未兑现项目 </a>
                            </div>
                        </li>

                        <li class="help_login"><a href="#">帮助</a></li>
                    </div>
                </ul>
            </div>
            <div class="top_nav_ti" style="display: none;" id="tips_help">
                <span class="arrow"></span>
                <p>初来乍到？先看看帮助吧！</p>
                <a href="#" class="view_btn" id="close_help">知道啦</a>
            </div>
        </div>
    </div>


    <div class="content wap content_about">


        <div class="bread_crumbs">
            <a href="/index.html">首页</a>
            ><a href="user.html">个人中心 </a> > 修改密码
        </div>
        <div class="pro_main">
            <form class="layui-form" lay-filter="user_form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名称</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" readonly lay-verify="required" autocomplete="off"
                               placeholder="请输入用户名称"
                               class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">不可修改。一般用于登入名</div>
                </div>
                <!--<div class="layui-form-item">-->
                <!--<label class="layui-form-label">用户昵称</label>-->
                <!--<div class="layui-input-block">-->
                <!--<input type="text" name="userNick"  lay-verify="required" autocomplete="off"-->
                <!--placeholder="请输入用户昵称"-->
                <!--class="layui-input">-->
                <!--</div>-->
                <!--</div>-->

                <div class="layui-form-item">
                    <label class="layui-form-label">原来密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="oldpassword" lay-verify="required|password" autocomplete="off"
                               placeholder="请输入原来密码"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">新密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="newPassword" lay-verify="required|password" autocomplete="off"
                               placeholder="请输入新密码"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" name="rePassword" lay-verify="required|password" autocomplete="off"
                               placeholder="请重复输入新密码"
                               class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                    </div>
                </div>


            </form>

        </div>
        <div class="pro_right">
            <div class="pro_tit">
                <h1 class="f_yahei">当前用户</h1>
                <div class="pro_view f14">

                </div>
            </div>
            <div class="pro_author">

                <ul class="pro_author_list">
                    <li>
                        <a href="#" target="_blank">
                            <img id="user_c_img" :src="userInfo.data.userImg" width="50" height="50"
                                 :alt="userInfo.data.username"/>
                            {{userInfo.data.username}}
                        </a>
                    </li>
                </ul>
            </div>
            <div class="pro_state"></div>
            <div>
                <table class="layui-table" style="width: 30%;">
                    <colgroup>
                        <col>
                    </colgroup>
                    <tbody>
                    <tr>
                        <td><a href="user.html">个人中心</a></td>
                    </tr>
                    <tr>
                        <td><a href="updaterUser.html">修改信息</a></td>
                    </tr>
                    <tr>
                        <td><a href="repassword.html">修改密码</a></td>
                    </tr>
                    <tr>
                        <td><a href="myaddress.html">我的地址</a></td>
                    </tr>
                    <tr>
                        <td><a href="myproject.html">我的项目</a></td>
                    </tr>
                    <tr>
                        <td><a href="mysupport.html">我的投资</a></td>
                    </tr>
                    </tbody>
                </table>
            </div>


        </div>


    </div>

    <div class="footer">
        <div class="ft_link_bg">
            <div class="ft_link">
                <dl class="ft_about">
                    <a href="http://www.baidu.com" target="_blank" title="权名众筹基地">
                        <dt>众筹</dt>
                    </a>

                </dl>
                <dl class="ft_coop">
                    <dt>合作伙伴</dt>
                    <dd>


                    </dd>
                </dl>
                <dl class="ft_help">
                    <dt>帮助拓展</dt>

                </dl>
            </div>
        </div>
    </div>

    <div class="ws_global_footer">
        <div class="ws_footer_info" style="min-width: 1000px">
            <div class="content">
                <p>
                    <a href="#" target="_blank">桂ICP备123456789</a>　
                    权名众筹　
                    权名众筹　
                    权名众筹　
                    <a href="#"
                       target="_blank"
                       style="width:16px;height:16px;display:inline-block;background:url('../images/wen_icon.png')">&nbsp;</a>
                </p>
                <p>
                    Copyright (C) 2018 权名众筹 Rights Reserved　
                    　
                    　
                    <a href="#" target="_blank">百度</a>
                </p>
            </div>
        </div>
    </div>
</div>

<script>


    //    获当项的具体信息


</script>


<script>

    //获取头部
    $.ajax({
        url: "/home/getCurrentUser",
        async: true,
        success: function (data) {
            if (data.code == 101) {
                alert("请先登录");
                window.location.href = "/home/login.html";
            }
            new Vue({
                el: '.h_right',
                data: {userInfo: data}
            })
            new Vue({
                el: '.pro_author',
                data: {userInfo: data}
            })
            console.log(data)
            layui.use(['form'], function () {
                var form = layui.form;

                //表单初始赋值
                form.val('user_form', data.data)

            });

        }

    });

    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.$
        ;


        //监听提交
        form.on('submit(demo1)', function (data) {
            console.log(data.field);
            $.ajax({
                url: "/home/changePassword",
                data: data.field,
                type: 'POST',
                success: function (d) {
                    layer.alert(d.msg, {
                        title: '修改结果'
                    });
                }
            });

            return false;
        });


    });
</script>


</body>
</html>
